// XmlMsg.h: interface for the CXmlMsg class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_XMLMSG_H__73469797_3A97_4E60_96CB_455EDB83DF66__INCLUDED_)
#define AFX_XMLMSG_H__73469797_3A97_4E60_96CB_455EDB83DF66__INCLUDED_

#import "msxml4.dll"		//well, you must have installed msxml4 or later
using namespace MSXML2;

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define SYSMSG ("000")
#define USLIST ("001")
#define USEMSG ("100")

class CXmlMsg  
{
	//
public:
	CString time;
	CString from;
	CString form;
	CString to;
	
public:
	CXmlMsg(const CString &str);
	CXmlMsg();
	~CXmlMsg();
public:
	operator LPCTSTR();
	CXmlMsg operator =(const CXmlMsg &msg);
	CXmlMsg operator=(const CString &str);
	operator CString();

protected:
	IXMLDOMDocumentPtr pXMLDom;
	CString szBuf;
	void InitMsg();
public:
	CXmlMsg(CXmlMsg& msg);
	BOOL IsAvail();
	BOOL IsAvail(const CString& str);
	BOOL DeCode();
	CString EnCode();
	class CContent
	{
	public:
		CContent(){num=-1;};
		int num;
		CString str;
	}content;

};

#endif // !defined(AFX_XMLMSG_H__73469797_3A97_4E60_96CB_455EDB83DF66__INCLUDED_)
